#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <queue>

using namespace std;
using LL = long long;
using PII = pair<int, int>;
// const int N = 200;

string s;


int main(){
#ifdef LOCALFLAG
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif


    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> s;
    int cnt = 0;
    for(int i = 0; i < s.length(); i ++){
        if(s[i] == '(') cnt ++;
        if(s[i] == ')') cnt --;

        if(cnt < 0){
            cout << "NO" << '\n';
            exit(0);
        }
    }

    if(cnt > 0) cout << "NO" << '\n';
    else cout << "YES" << '\n';



    return 0;
}